package com.dci.controller.schedule;

import com.dci.model.schedule.ProgressDetails;
import com.dci.result.ResultInfo;
import com.dci.service.schedule.ProgressDetailsService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * All rights Reserved, Designed By 姑苏区政府大数据中心
 *
 * @version V1.0
 * @Title: null.java
 * @Package com.dci.controller.schedule
 * @Description: 查询资金管理所有数据
 * @author: njj
 * @date: 2019/2/25
 * @Copyright: 2019 姑苏区政府大数据中心. All rights reserved.
 * 注意：本内容仅限于姑苏区政府大数据中心内部传阅，禁止外泄以及用于其他的商业目
 */
@Controller
@RequestMapping("/details")
public class ProgressDetailsController {
    @Resource
    private ProgressDetailsService progressDetailsService;

    /**
     * 查询全部资金明细
     *
     * @param details
     * @return
     */
    @PostMapping("/selectAll")
    @ResponseBody
    public List<ProgressDetails> selectAllDetails(@RequestParam(value = "form", required = false) String details) {
        return progressDetailsService.selectAllData(details);
    }

    /**
     * 删除资金明细
     *
     * @param idList
     * @return
     */
    @PostMapping("/deleteById")
    @ResponseBody
    public ResultInfo deleteById(@RequestParam(value = "idList", required = false) List<String> idList) {
        return progressDetailsService.deleteById(idList);
    }

    /**
     * @param projectId
     * @return
     */
    @PostMapping("/selectByProjectId")
    @ResponseBody
    public List<ProgressDetails> selectByProjectId(@RequestParam(value = "projectId", required = false) String projectId) {
        return progressDetailsService.selectByProjectId(projectId);
    }
}
